from model.common import PageModel
from typing import List, Optional

class GetCompanyExpireDeviceListReq:
    def __init__(self, page_model: PageModel):
        self.page_model = page_model

class CardInfo:
    def __init__(
        self,
        device_num: str,  # 设备编号
        imsi: str,  # 国际移动用户识别码
        msisdn: str,  # 物联网卡号
        e_period: str,  # 到期时间
        card_status: str,  # 卡片状态
        price: int,  # 续费单价 单位/分
    ):
        self.device_num = device_num
        self.imsi = imsi
        self.msisdn = msisdn
        self.e_period = e_period
        self.card_status = card_status
        self.price = price

class GetCompanyExpireDeviceListData:
    def __init__(self, list: List[CardInfo], count: int):
        self.list = list
        self.count = count

class GetCompanyExpireDeviceListResp:
    def __init__(
        self,
        code: int,  # 状态码，1 表示成功，-1表示失败
        message: str,  # 消息描述
        data: Optional[GetCompanyExpireDeviceListData],  # 数据，可以为 null
        timestamp: int,  # 时间戳
    ):
        self.code = code
        self.message = message
        self.data = data
        self.timestamp = timestamp

class CreateCompanyRenewOrderReq:
    def __init__(
        self,
        device_nums: Optional[List[str]],  # 设备编号列表.不传或者为空表示续费所有待续费设备
        out_trade_no: Optional[str],  # 续费订单号.日期时间+6位随机数字,示例: 2025010817301066258
    ):
        self.device_nums = device_nums
        self.out_trade_no = out_trade_no

class CreateCompanyRenewOrderData:
    def __init__(
        self,
        atu_sub_mer_id: str,  # 子商户ID
        bank_code: str,  # 银行代码
        bank_message: str,  # 银行返回的消息
        hf_seq_id: str,  # 汇付序列号
        huifu_id: str,  # 汇付ID
        is_clean_split: str,  # 是否清分
        party_order_id: str,  # 合作方订单ID
        qr_code: str,  # 二维码信息
        req_date: str,  # 请求日期
        req_seq_id: str,  # 请求序列号
        resp_code: str,  # 响应代码
        resp_desc: str,  # 响应描述
        trade_type: str,  # 交易类型
        trans_amt: str,  # 交易金额
        trans_stat: str,  # 交易状态
        unconfirm_amt: str,  # 未确认金额
    ):
        self.atu_sub_mer_id = atu_sub_mer_id
        self.bank_code = bank_code
        self.bank_message = bank_message
        self.hf_seq_id = hf_seq_id
        self.huifu_id = huifu_id
        self.is_clean_split = is_clean_split
        self.party_order_id = party_order_id
        self.qr_code = qr_code
        self.req_date = req_date
        self.req_seq_id = req_seq_id
        self.resp_code = resp_code
        self.resp_desc = resp_desc
        self.trade_type = trade_type
        self.trans_amt = trans_amt
        self.trans_stat = trans_stat
        self.unconfirm_amt = unconfirm_amt

class CreateCompanyRenewOrderResp:
    def __init__(
        self,
        code: int,  # 状态码，1 表示成功，-1表示失败
        message: str,  # 消息描述
        data: Optional[CreateCompanyRenewOrderData],  # 数据，可以为 null
        timestamp: int,  # 时间戳
    ):
        self.code = code
        self.message = message
        self.data = data
        self.timestamp = timestamp

class GetCompanyRenewStatusReq:
    def __init__(self, out_trade_no: str):  # 续费订单号.日期时间+6位随机数字,示例: 2025010817301066258
        self.out_trade_no = out_trade_no

class GetCompanyRenewStatusData:
    def __init__(
        self,
        out_trade_no: str,  # 订单号
        total_fee: int,  # 总金额 分
        num: int,  # 数量
        device_num: str,  # 设备号
        iot_phone: str,  # 卡号
        maturity_at: str,  # 到期时间
        renew_fee: int,  # 设备续费金额
        is_paid: int,  # 是否支付
        renew_state: int,  # 处理状态
        payment_at: str,  # 支付成功时间
        success_at: str,  # 处理成功时间
    ):
        self.out_trade_no = out_trade_no
        self.total_fee = total_fee
        self.num = num
        self.device_num = device_num
        self.iot_phone = iot_phone
        self.maturity_at = maturity_at
        self.renew_fee = renew_fee
        self.is_paid = is_paid
        self.renew_state = renew_state
        self.payment_at = payment_at
        self.success_at = success_at

class GetCompanyRenewStatusResp:
    def __init__(
        self,
        code: int,  # 状态码，1 表示成功，-1表示失败
        message: str,  # 消息描述
        data: Optional[GetCompanyRenewStatusData],  # 数据，可以为 null
        timestamp: int,  # 时间戳
    ):
        self.code = code
        self.message = message
        self.data = data
        self.timestamp = timestamp